/***********************************************************
 
 File name: AAHomeVC.h
 Author:    xuwei
 Description:
 首页VC
 
 2018/02/27: Created
 
 ************************************************************/

#import "AAHomeVC.h"

@interface AAHomeVC ()

@end

@implementation AAHomeVC
#pragma mark - Life Circle 生命周期
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavigationWithTitle:@"" seletor:nil];
    [self setLeftBarbuttonItem];
    [self setRightBarbuttonItem];
}

#pragma mark - Public Method 公开方法（头文件声明的方法）
#pragma mark - System Delegate Method 系统自带的代理方法
#pragma mark - System DataSource Method 系统自带的数据源方法
#pragma mark - Custom Delegate Method 自定义的代理方法
#pragma mark - Event Response Method 事件响应方法
/**
 消息按钮的点击事件
 */
- (void)rightItemAction {

}

#pragma mark - Private Method 私有方法
/**
 设置导航栏左边item
 */
- (void)setLeftBarbuttonItem {
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithTitle:@"上海" style:UIBarButtonItemStylePlain target:self action:@selector(showAlertController)];
  
    self.navigationItem.leftBarButtonItem = leftItem;
    [self.navigationItem.leftBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName: [UIFont boldSystemFontOfSize:kTextFontSize16]} forState:UIControlStateNormal];
    
    [self.navigationItem.leftBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName: [UIFont boldSystemFontOfSize:kTextFontSize16]} forState:UIControlStateHighlighted];
    
    [self.navigationItem.leftBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName: [UIFont boldSystemFontOfSize:kTextFontSize16]} forState:UIControlStateDisabled];
//    self.navigationItem.leftBarButtonItem.enabled = NO;
}

/**
 设置导航栏左边item
 */
- (void)setRightBarbuttonItem {
    UIImage *image = [[UIImage imageNamed:@"news"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(rightItemAction)];
    self.navigationItem.rightBarButtonItem = rightItem;
}

- (void)showAlertController {
//    UIAlertController *alertContorller = [UIAlertController alertControllerWithTitle:@"评价发表成功!" message:@"感谢您的信任，期待继续为您服务。" preferredStyle:UIAlertControllerStyleAlert];
//    [alertContorller setTitleColor:[UIColor colorWithHexString:kLikeRedColor] font:[UIFont systemFontOfSize:kTextFontSize16]];
//
//    [alertContorller setMessageColor:[UIColor colorWithHexString:kAlertMessageLightGrayColor] font:[UIFont systemFontOfSize:14]];
//
//    UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//
//    }];
//
//    [alertContorller addAction:confirmAction color:[UIColor colorWithHexString:kAlertActionGrayColor]];
//
//    [self presentViewController:alertContorller animated:YES completion:nil];
    
    NSString *message = @"车辆为重度脏程度\n我们暂时无法提供服务";
    message = @"您的订单在30分钟内未支付将被取消，请尽快完成支付。";
    UIAlertController *finishWashCarVC = [UIAlertController alertControllerWithTitle:@"哈哈哈哈" message:message preferredStyle:UIAlertControllerStyleAlert];
    [finishWashCarVC setMessageColor:[UIColor colorWithHexString:kAlertActionGrayColor] font:[UIFont systemFontOfSize:kTextFontSize14]];
    
    UIAlertAction *finishWashCarAction = [UIAlertAction actionWithTitle:@"结束洗车" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    
    [finishWashCarVC addAction:finishWashCarAction color:[UIColor colorWithHexString:kAlertActionGrayColor]];
    
    [self presentViewController:finishWashCarVC animated:YES completion:nil];
}

#pragma mark - Getters and Setters Method getter和setter方法

@end
